def find(self, by, locator):
    try:
        return self.driver.find_element(by, locator)
    except Exception as e:
        print("未找到元素，处理异常")
        for black in self.black_list:
            # 查找黑名单中每一个元素
            eles = self.driver.find_element(*black)
            if len(eles) > 0:
                # 去掉弹窗
                eles[0].click()
                # 继续查找元素
                return self.find(by, locator)
        raise e

def black_wrapper(fun):
    def run(*args, **kwargs):
        from app_study.app_snowball_po.base.base_page import BasePage
        basepage= args[0]
        try:
            return fun(*args, **kwargs)
        except Exception as e:
            print("未找到元素，处理异常")
            for black in basepage.black_list:
                # 查找黑名单中每一个元素
                eles = basepage.driver.find_elements(*black)
                if len(eles) > 0:
                    # 去掉弹窗
                    eles[0].click()
                    # 继续查找元素
                    return fun(*args, **kwargs)
            raise e
    return run